package com.mobile.collect.beans;

import com.mobile.collect.db.DaoSession;
import com.mobile.collect.db.ExportInfoDao;
import com.mobile.collect.db.ExportResultInfoDao;

import org.greenrobot.greendao.DaoException;
import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.ToMany;

import java.util.List;

/**
 * 类名: WaitUpladInfo
 * 作者: 李学伟
 * 日期: 2020年09月30日 11:37
 * 描述:
 */
@Entity
public class ExportInfo {
    @Id
    private Long _ID;
    private String exportTime;
    private boolean hadUploaded;

    public ExportInfo(String exportTime) {
        this.exportTime = exportTime;
    }

    @Generated(hash = 1631529157)
    public ExportInfo(Long _ID, String exportTime, boolean hadUploaded) {
        this._ID = _ID;
        this.exportTime = exportTime;
        this.hadUploaded = hadUploaded;
    }

    @Generated(hash = 2070738858)
    public ExportInfo() {
    }

    public Long get_ID() {
        return this._ID;
    }

    public void set_ID(Long _ID) {
        this._ID = _ID;
    }

    public String getExportTime() {
        return this.exportTime;
    }

    public void setExportTime(String exportTime) {
        this.exportTime = exportTime;
    }

    /**
     * To-many relationship, resolved on first access (and after reset).
     * Changes to to-many relations are not persisted, make changes to the target entity.
     */
    @Generated(hash = 1513157245)
    public List<ExportResultInfo> getResultInfos() {
        if (resultInfos == null) {
            final DaoSession daoSession = this.daoSession;
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            ExportResultInfoDao targetDao = daoSession.getExportResultInfoDao();
            List<ExportResultInfo> resultInfosNew = targetDao
                    ._queryExportInfo_ResultInfos(_ID);
            synchronized (this) {
                if (resultInfos == null) {
                    resultInfos = resultInfosNew;
                }
            }
        }
        return resultInfos;
    }

    /** Resets a to-many relationship, making the next get call to query for a fresh result. */
    @Generated(hash = 341086428)
    public synchronized void resetResultInfos() {
        resultInfos = null;
    }

    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#delete(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 128553479)
    public void delete() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.delete(this);
    }

    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#refresh(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 1942392019)
    public void refresh() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.refresh(this);
    }

    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#update(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 713229351)
    public void update() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.update(this);
    }

    public boolean getHadUploaded() {
        return this.hadUploaded;
    }

    public void setHadUploaded(boolean hadUploaded) {
        this.hadUploaded = hadUploaded;
    }

    /** called by internal mechanisms, do not call yourself. */
    @Generated(hash = 359884544)
    public void __setDaoSession(DaoSession daoSession) {
        this.daoSession = daoSession;
        myDao = daoSession != null ? daoSession.getExportInfoDao() : null;
    }

    @ToMany(referencedJoinProperty = "parentId")
    private List<ExportResultInfo> resultInfos;
    /** Used to resolve relations */
    @Generated(hash = 2040040024)
    private transient DaoSession daoSession;
    /** Used for active entity operations. */
    @Generated(hash = 2021307457)
    private transient ExportInfoDao myDao;


}
